<?php
//if (isset($_POST["submit"])) {
    $email = $_POST["email"];
    if ($email == "") {
        echo "invalid email address";
    }
    try {
        $conn = mysql_connect('localhost', 'root', '');
        if (!$conn) {
            die('Could not connect: ' . mysql_error());
        } else {
            mysql_select_db("j2eedevelopers", $conn);
           // echo 'Connected successfully';
		 //  $cdt=date('d-m-Y');
                $cdt = date("d/m/y : H:i:s", time());
                 // print_r($cdt);
                  //print_r($date);
		   //print_r($cdt);
		  // exit;
           mysql_query("INSERT INTO j2eedevelopers (cdt,email,site) VALUES('$cdt', '$email', 'j2eedevelopers.net')");
           // mysql_query("INSERT INTO j2eedevelopers (EMAIL, PROJECT) VALUES('$email', 'jprojects.net')");            
//mysql_query("SELECT * FROM j2eedevelopers WHERE Email=" . $email);
            mysql_close($conn);
        }
    } catch (Exception $e) {
        echo $e->getMessage();
    }
   if (empty($error_message)){
  header("location: congrats.html");
 }

//echo "Record inserted successfully.";
//}else{
 //   echo "Invalid submit";
//}
?>